<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>PHP框架_PHP程序员博客|高蒙个人博客</title>
    <meta name="Keywords" content="个人博客,PHP博客,PHP博客程序,高蒙博客,高蒙个人博客,php程序员博客,程序员个人博客"/>
    <meta name="Description" content="高蒙个人博客是以PHP技术为主的程序员个人博客。博客主要发布博主在开发中遇到的PHP/Linux/jQuery/Js/Mysql/Html/css/ios/android等相关知识,同时博客程序也是以PHP语言开发，使用流行的LNMP架构，让个人博客程序方便自由伸缩系统。"/>
    <meta property="qc:admins" content="172533702763053056701166375"/>
    <link rel="stylesheet" href="./css/bootstrap.min.css">
    <link rel="stylesheet" href="./css/font-awesome.min.css">
    <link rel="stylesheet" href="./css/index.css">
    <link rel="stylesheet" href="./css/atelier-seaside-light.css">
</head>
<body class="body_bg"><!--head begin-->
<div class="container">
    <div class="row">
        <div class="col-md-12">
            <div class="navbar navbar-inverse navbar-fixed-top">
                <div class="container">
                    <div class="navbar-header">
                        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button>
                    </div>
                    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                        <ul class="nav navbar-nav">
                            <li class="active"><a href="/index.html">首页</a></li>
                            <li class="dropdown"><a href="/Article/cate/id/1.html" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">PHP笔记<span class="caret"></span></a>
                                <ul class="dropdown-menu">
                                    <li><a href="/Article/cate/id/1.html">PHP笔记</a></li>
                                    <li><a href="/Article/cate/id/2.html">PHP框架</a></li>
                                    <li><a href="/Article/cate/id/5.html">|--CodeIgniter</a></li>
                                    <li><a href="/Article/cate/id/6.html">|--zend framework</a></li>
                                    <li><a href="/Article/cate/id/7.html">|--Yii2</a></li>
                                    <li><a href="/Article/cate/id/8.html">|--Thinkphp</a></li>
                                    <li><a href="/Article/cate/id/3.html">CMS系统</a></li>
                                    <li><a href="/Article/cate/id/9.html">|--DedeCMS</a></li>
                                    <li><a href="/Article/cate/id/10.html">|--EmpireCMS</a></li>
                                    <li><a href="/Article/cate/id/11.html">|--EcshopCMS</a></li>
                                    <li><a href="/Article/cate/id/12.html">|--DestoonCMS</a></li>
                                    <li><a href="/Article/cate/id/13.html">|--DiscuzCMS</a></li>
                                    <li><a href="/Article/cate/id/4.html">PHP技术</a></li>
                                    <li><a href="/Article/cate/id/17.html">|--Redis</a></li>
                                    <li><a href="/Article/cate/id/18.html">|--Memcached</a></li>
                                    <li><a href="/Article/cate/id/22.html">|--PHP</a></li>
                                    <li><a href="/Article/cate/id/19.html">PHP工具</a></li>
                                    <li><a href="/Article/cate/id/20.html">|--Phpstorm</a></li>
                                    <li><a href="/Article/cate/id/21.html">数据采集</a></li>
                                    <li><a href="/Article/cate/id/30.html">|--火车头采集器</a></li>
                                    <li><a href="/Article/cate/id/26.html">其他知识</a></li>
                                </ul>
                            </li>
                            <li class="dropdown"><a href="/Article/cate/id/14.html" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">前端技术<span class="caret"></span></a>
                                <ul class="dropdown-menu">
                                    <li><a href="/Article/cate/id/14.html">前端技术</a></li>
                                    <li><a href="/Article/cate/id/15.html">jQuery/js</a></li>
                                    <li><a href="/Article/cate/id/16.html">Html/Css</a></li>
                                    <li><a href="/Article/cate/id/29.html">Bootstrap</a></li>
                                </ul>
                            </li>
                            <li class="dropdown"><a href="/Article/cate/id/23.html" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">服务器<span class="caret"></span></a>
                                <ul class="dropdown-menu">
                                    <li><a href="/Article/cate/id/23.html">服务器</a></li>
                                    <li><a href="/Article/cate/id/24.html">Linux</a></li>
                                    <li><a href="/Article/cate/id/25.html">Nginx</a></li>
                                </ul>
                            </li>
                            <li class="dropdown"><a href="/Article/cate/id/27.html" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">数据库<span class="caret"></span></a>
                                <ul class="dropdown-menu">
                                    <li><a href="/Article/cate/id/27.html">数据库</a></li>
                                    <li><a href="/Article/cate/id/28.html">Mysql</a></li>
                                    <li><a href="/Article/cate/id/35.html">SQL SERVER</a></li>
                                </ul>
                            </li>
                            <li class="dropdown"><a href="/Article/cate/id/32.html" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">闲言碎语<span class="caret"></span></a>
                                <ul class="dropdown-menu">
                                    <li><a href="/Article/cate/id/32.html">闲言碎语</a></li>
                                </ul>
                            </li>
                            <li class="dropdown"><a href="/Jquery.html" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">工具手册<span class="caret"></span></a>
                                <ul class="dropdown-menu"><!--li style="display:none;"><a href="/Article/archives.html">文章归档</a></li-->
                                    <li><a href="/Jquery.html">JQuery在线手册</a></li>
                                    <li><a href="/Tools/index.html">在线工具</a></li>
                                </ul>
                            </li>
                            <li><a href="/Link/index.html">友情链接</a></li>
                            <li><a href="/Article/message.html">联系博主</a></li>
                            <li><a href="javascript:;" data-toggle="modal" data-target="#mylogin">登录·注册</a></li>
                        </ul>
                        <form class="navbar-form navbar-right index_form" role="search" action="/Article/soso.html" method="GET">
                            <div class="input-group ">
                                <div class="form-group"><input type="text" class="form-control input-sm index_keyword" name="keyword" placeholder="搜一搜 才知道..."></div>
                                <span class="input-group-btn"><button class="btn btn-default btn-sm index_soso" type="button">Go!</button></span></div>
                        </form>
                        <ul class="nav navbar-nav navbar-right"></ul><!--<ul class="navbar-form navbar-right"><button  target="_blank" class="btn btn-default btn-success" data-toggle="modal" data-target="#mylogin">登录·注册</button></ul>--></div>
                </div>
            </div>
        </div>
    </div>
</div><!--head end-->
<div class="container m-t-60 bg-fff p-t-10">
    <div class="row">
        <div class="col-md-8"><!--<h3>人生要是没有理想， 那跟一条咸鱼有什么分别。</h3><form action="/Article/soso.html" method="GET" class="index_form"><div class="input-group"><input type="text" class="form-control input-lg index_keyword" name="keyword" placeholder="搜一搜 才知道..."><span class="input-group-btn"><button class="btn btn-default btn-lg index_soso" type="button">Go!</button></span></div></form>-->
            <!--<p class="text-muted p-t-10 hidden-xs"><a data-type="8" data-tmpl="527x25" data-tmplid="224" data-style="2" data-border="0" biz-g_lgo="0" biz-g_hot_x="11" biz-g_hot_site="14" biz-g_hot_space="0" biz-g_hot_color="#000" href="#">文字链</a></p>-->
            <div id="carousel-example-generic" class="carousel slide" data-ride="carousel"><!-- Indicators -->
                <ol class="carousel-indicators">
                    <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li><!--<li data-target="#carousel-example-generic" data-slide-to="1"></li><li data-target="#carousel-example-generic" data-slide-to="2"></li>--></ol><!-- Wrapper for slides -->
                <div class="carousel-inner" role="listbox">
                    <div class="item active"><img src="./images/1.png" alt="..." class="img-responsive">
                        <div class="carousel-caption"> 水墨印象，龙行天下</div>
                    </div>
                    <!--<div class="item"><script type="text/javascript">                                                        var cpro_id = "u2780606";                        </script><script src="http://cpro.baidustatic.com/cpro/ui/c.js" type="text/javascript"></script><div class="carousel-caption"></div></div><div class="item"><img src="/Public/Static/images/3.png" alt="..."  class="img-responsive"><div class="carousel-caption">                            123                        </div></div>-->
                </div><!-- Controls --><a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev"><span class="glyphicon glyphicon-chevron-left"></span><span class="sr-only">Previous</span></a><a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next"><span class="glyphicon glyphicon-chevron-right"></span><span class="sr-only">Next</span></a></div>
        </div>
        <div class="col-md-4">
            <div class="tree">
                <div class="alert alert-success alert-dismissible" role="alert">
                    <div class="row">
                        <div class="col-md-4"><img src="./images/login.jpg" alt="高蒙个人博客" title="高蒙个人博客" class="img-circle img-responsive center-block"></div>
                        <div class="col-md-8">
                            <address style="margin-bottom: 0"><strong>高蒙</strong><br><strong>简介：</strong>男，92年，php程序员！<br><strong>电子邮箱：</strong><br><a href="mailto:#">936594075@qq.com</a><br></address><!--<strong>欢迎你，游客</strong>&nbsp;<p>这家伙有点懒，还没写个性签名！</p><button class="btn btn-info" id="btn_login">我要登录</button>&nbsp;<button class="btn btn-warning" id="btn_regist">我要注册</button>                            --></div>
                        <div class="col-md-12">
                            <blockquote style="font-size: 14px; padding: 4px 0px 4px 20px;"><p>人生要是没有理想， 那跟一条咸鱼有什么分别。</p>
                                <footer>来自<cite title="Source Title">星爷</cite></footer>
                            </blockquote>
                            <hr style="margin-bottom: 2px"/>
                            <ul class="list-inline col-md-12">
                                <li class="text-center col-md-4"><h6 class="text-danger">636</h6><h5>文章总数</h5></li>
                                <li class="text-center col-md-4"><h6 class="text-danger">264959</h6><h5>访问人气</h5></li>
                                <li class="text-center col-md-4"><h6 class="text-danger">536天</h6><h5>建站天数</h5></li>
                            </ul><!--                            <button class="btn btn-info" id="btn_login">我要登录</button>&nbsp;<button class="btn btn-warning" id="btn_regist">我要注册</button>&nbsp;<a href="" class="btn btn-danger">我要建站</a>                            --></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="container m-t-10">
    <div class="row">
        <div class="col-md-9 bg-fff p-t-10 b-r-s"><h4><a href="/Article/info/id/646.html" target="_blank" class="text-primary">整理常用thinkphp的模型操作方法</a></h4>
            <p class="text-muted"><span class="glyphicon glyphicon-th-list"></span>&nbsp;<a href="/Article/cate/id/8.html">Thinkphp</a>&nbsp;<span class="glyphicon glyphicon-user"></span>&nbsp;高蒙&nbsp;<span class="glyphicon glyphicon-eye-open"></span>&nbsp;阅读(122)&nbsp;<!--<span class="glyphicon glyphicon-thumbs-up"></span>&nbsp;&nbsp;--><span class="glyphicon glyphicon-edit"></span>&nbsp;评论(0)&nbsp;</small><span class="glyphicon glyphicon-time"></span>&nbsp;1个月前&nbsp;</p>
            <p class="text-muted">项目中需要用到很多模型的操作方法，这里自己结合经验整理了一些我认为常用的方法。以下实例用 USER 表 作为数据表，进行演示。/**&nbsp;*&nbsp;列表&nbsp;加分页&nbsp;*&nbsp;@param&nbsp;string&nbsp;$field&nbsp;*&nbsp;@param&nbsp;array&nbsp;$where&nbsp;*&nbsp;@param&nbsp;int&nbsp;$page&nbsp;*&nbsp;@param&nbsp;i</p>
            <hr/>
            <h4><a href="/Article/info/id/644.html" target="_blank" class="text-primary">如何使用thinkphp路由正则表达式优化地址链接</a></h4>
            <p class="text-muted"><span class="glyphicon glyphicon-th-list"></span>&nbsp;<a href="/Article/cate/id/8.html">Thinkphp</a>&nbsp;<span class="glyphicon glyphicon-user"></span>&nbsp;高蒙&nbsp;<span class="glyphicon glyphicon-eye-open"></span>&nbsp;阅读(189)&nbsp;<!--<span class="glyphicon glyphicon-thumbs-up"></span>&nbsp;&nbsp;--><span class="glyphicon glyphicon-edit"></span>&nbsp;评论(2)&nbsp;<span class="glyphicon glyphicon glyphicon-tags"></span>&nbsp;<a
                    href="/Article/soso/keyword/thinkphp.html" class="text-muted">thinkphp</a>&nbsp;<a href="/Article/soso/keyword/路由.html" class="text-muted">路由</a>&nbsp;<a href="/Article/soso/keyword/正则表达式.html" class="text-muted">正则表达式</a>&nbsp;</small><span class="glyphicon glyphicon-time"></span>&nbsp;1个月前&nbsp;</p>
            <p class="text-muted">用thinkphp开发项目，其中搜索模块需要携带很多的参数，就会出现地址栏的链接很长，这样不仅看上去不美观，对于搜索引擎来说也是不友好的链接。于是，就需要将其修改成简短干练的地址链接。thinkphp中是支持路由重写的，需要自己编写重写规则。在编写的过程中，遇到一个问题。可以说是一个老大难的问题，那就是中文，搜索关键字需要匹配中文。在尝试各种正则匹配规则都失败的情况下，我这里只能写成?keyword=关键字的格式。下面我们看，具体的实例：未优化地址：/model/search.php?style</p>
            <hr/>
            <h4><a href="/Article/info/id/586.html" target="_blank" class="text-primary">thinkphp提示Undefined class constant 'MYSQL_ATTR_INIT_COMMAND'报错的解决方法</a></h4>
            <p class="text-muted"><span class="glyphicon glyphicon-th-list"></span>&nbsp;<a href="/Article/cate/id/8.html">Thinkphp</a>&nbsp;<span class="glyphicon glyphicon-user"></span>&nbsp;高蒙&nbsp;<span class="glyphicon glyphicon-eye-open"></span>&nbsp;阅读(319)&nbsp;<!--<span class="glyphicon glyphicon-thumbs-up"></span>&nbsp;&nbsp;--><span class="glyphicon glyphicon-edit"></span>&nbsp;评论(0)&nbsp;<span class="glyphicon glyphicon glyphicon-tags"></span>&nbsp;<a
                    href="/Article/soso/keyword/thinkphp.html" class="text-muted">thinkphp</a>&nbsp;</small><span class="glyphicon glyphicon-time"></span>&nbsp;5个月前&nbsp;</p>
            <p class="text-muted">在操作服务器的时候不知道怎么回事突然提示Undefined class constant 'MYSQL_ATTR_INIT_COMMAND'，查找资料发现是php缺少pdo_mysql的扩展。:(Undefined class constant 'MYSQL_ATTR_INIT_COMMAND'错误位置FILE: /usr/local/apache/htdocs/wechat/ThinkPHP/Library/T</p>
            <hr/>
            <h4><a href="/Article/info/id/584.html" target="_blank" class="text-primary">thinkphp 行为扩展 钩子与插件的实现</a></h4>
            <p class="text-muted"><span class="glyphicon glyphicon-th-list"></span>&nbsp;<a href="/Article/cate/id/8.html">Thinkphp</a>&nbsp;<span class="glyphicon glyphicon-user"></span>&nbsp;高蒙&nbsp;<span class="glyphicon glyphicon-eye-open"></span>&nbsp;阅读(329)&nbsp;<!--<span class="glyphicon glyphicon-thumbs-up"></span>&nbsp;&nbsp;--><span class="glyphicon glyphicon-edit"></span>&nbsp;评论(0)&nbsp;</small><span class="glyphicon glyphicon-time"></span>&nbsp;5个月前&nbsp;</p>
            <p class="text-muted">在熟悉onthink程序的时候，看到后台有钩子和插件的管理界面。很感兴趣，之前就对行为不怎么理解和使用，借着这次机会好好的研究下。行为（Behavior）是一个比较抽象的概念，类似于AOP编程中的“切面”的概念，给某一个切面绑定相关行为就成了一种类AOP编程的思想。在开始之前我们看看它是怎么个流程？1、注册行为。2、具体行为的操作。3、行为里面如何注册插件。4、视图的调用。按照官网的实例，自己亲生的实践一下，下面是我的实践代码。配置文件：Application/common/conf/confi</p>
            <hr/>
            <h4><a href="/Article/info/id/580.html" target="_blank" class="text-primary">利用thinkphp string()类生成随机字符串不重复</a></h4>
            <p class="text-muted"><span class="glyphicon glyphicon-th-list"></span>&nbsp;<a href="/Article/cate/id/8.html">Thinkphp</a>&nbsp;<span class="glyphicon glyphicon-user"></span>&nbsp;高蒙&nbsp;<span class="glyphicon glyphicon-eye-open"></span>&nbsp;阅读(695)&nbsp;<!--<span class="glyphicon glyphicon-thumbs-up"></span>&nbsp;&nbsp;--><span class="glyphicon glyphicon-edit"></span>&nbsp;评论(1)&nbsp;<span class="glyphicon glyphicon glyphicon-tags"></span>&nbsp;<a
                    href="/Article/soso/keyword/thinkphp.html" class="text-muted">thinkphp</a>&nbsp;<a href="/Article/soso/keyword/字符串.html" class="text-muted">字符串</a>&nbsp;</small><span class="glyphicon glyphicon-time"></span>&nbsp;5个月前&nbsp;</p>
            <p class="text-muted">在thinkphp中有个string类系统需要优惠券的生成程序，保证每次生成的优惠券都是唯一的，一次生成的数量不是固定的。分享我的做法:1、查出表里已有的优惠码。2、在外部定义一个值，记录内部实际有效运行的次数。3、当内部循环的数量等于实际需求生成的数量时，跳出循环。4、避免循环的插入数据，手动的拼接SQL语句，然后执行。代码：$coupon&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=&nbsp;M(&#39;coupon&#39;)-&gt;getCouponLi</p>
            <hr/>
            <h4><a href="/Article/info/id/579.html" target="_blank" class="text-primary">如何解决thinkphp query()执行原生SQL语句成功结果报错的问题</a></h4>
            <p class="text-muted"><span class="glyphicon glyphicon-th-list"></span>&nbsp;<a href="/Article/cate/id/8.html">Thinkphp</a>&nbsp;<span class="glyphicon glyphicon-user"></span>&nbsp;高蒙&nbsp;<span class="glyphicon glyphicon-eye-open"></span>&nbsp;阅读(492)&nbsp;<!--<span class="glyphicon glyphicon-thumbs-up"></span>&nbsp;&nbsp;--><span class="glyphicon glyphicon-edit"></span>&nbsp;评论(0)&nbsp;<span class="glyphicon glyphicon glyphicon-tags"></span>&nbsp;<a
                    href="/Article/soso/keyword/thinkphp.html" class="text-muted">thinkphp</a>&nbsp;</small><span class="glyphicon glyphicon-time"></span>&nbsp;5个月前&nbsp;</p>
            <p class="text-muted">在thinkphp中使用原生SQL语句的时候，明明记录插入表成功了，可是前台却报错。如下：: [ SQL语句 ] : INSERT INTO coupon (codes,price,adminname,admin_uid,addtime) VALUES('11IcRkJUMB',500,'哈哈哈',1,1478658383);错误位置FILE: F:\php</p>
            <hr/>
            <h4><a href="/Article/info/id/257.html" target="_blank" class="text-primary">yii2上传图片报错 The fileinfo PHP extension is not installed</a></h4>
            <p class="text-muted"><span class="glyphicon glyphicon-th-list"></span>&nbsp;<a href="/Article/cate/id/7.html">Yii2</a>&nbsp;<span class="glyphicon glyphicon-user"></span>&nbsp;高蒙&nbsp;<span class="glyphicon glyphicon-eye-open"></span>&nbsp;阅读(624)&nbsp;<!--<span class="glyphicon glyphicon-thumbs-up"></span>&nbsp;&nbsp;--><span class="glyphicon glyphicon-edit"></span>&nbsp;评论(0)&nbsp;<span class="glyphicon glyphicon glyphicon-tags"></span>&nbsp;<a
                    href="/Article/soso/keyword/yii2.html" class="text-muted">yii2</a>&nbsp;<a href="/Article/soso/keyword/fileinfo.html" class="text-muted">fileinfo</a>&nbsp;<a href="/Article/soso/keyword/PHP.html" class="text-muted">PHP</a>&nbsp;</small><span class="glyphicon glyphicon-time"></span>&nbsp;7个月前&nbsp;</p>
            <p class="text-muted">在学习yii2框架上传图片的时候，出现了下面的报错信息：Invalid&nbsp;Configuration&nbsp;–&nbsp;yii\base\InvalidConfigExceptionThe&nbsp;fileinfo&nbsp;PHP&nbsp;extension&nbsp;is&nbsp;not&nbsp;installed.上面报错的意思就是说我们的PHP扩展fileinfo没有安装。我本地用的是phpstudy直接在php扩展里面配置开启即可。至于，服务器上面的安装，暂时</p>
            <hr/>
            <h4><a href="/Article/info/id/255.html" target="_blank" class="text-primary">yii2设置cookie无效的解决方法</a></h4>
            <p class="text-muted"><span class="glyphicon glyphicon-th-list"></span>&nbsp;<a href="/Article/cate/id/7.html">Yii2</a>&nbsp;<span class="glyphicon glyphicon-user"></span>&nbsp;高蒙&nbsp;<span class="glyphicon glyphicon-eye-open"></span>&nbsp;阅读(433)&nbsp;<!--<span class="glyphicon glyphicon-thumbs-up"></span>&nbsp;&nbsp;--><span class="glyphicon glyphicon-edit"></span>&nbsp;评论(0)&nbsp;<span class="glyphicon glyphicon glyphicon-tags"></span>&nbsp;<a
                    href="/Article/soso/keyword/yii2.html" class="text-muted">yii2</a>&nbsp;<a href="/Article/soso/keyword/cookie.html" class="text-muted">cookie</a>&nbsp;<a href="/Article/soso/keyword/cookie无效.html" class="text-muted">cookie无效</a>&nbsp;</small><span class="glyphicon glyphicon-time"></span>&nbsp;7个月前&nbsp;</p>
            <p class="text-muted">在学习的yii2框架cookies设置的时候，遇到很纠结的问题。就是我们在设置cookies时候，总是无效。怎么设置都是不对的。将手册上的代码拷贝下来依然是无效的。这是怎么回事？经过研究，找到了解决方法。请看我的代码：前提是我默认配置好了cookies密钥。$cookies = Yii::$app-&gt;response-&gt;cookies;// 设置cookie有效期$cookies-&gt;add(new \yii\web\Cookie(</p>
            <hr/>
            <h4><a href="/Article/info/id/254.html" target="_blank" class="text-primary">thinkphp如何压缩html页面输出,提升网页打开速度</a></h4>
            <p class="text-muted"><span class="glyphicon glyphicon-th-list"></span>&nbsp;<a href="/Article/cate/id/8.html">Thinkphp</a>&nbsp;<span class="glyphicon glyphicon-user"></span>&nbsp;高蒙&nbsp;<span class="glyphicon glyphicon-eye-open"></span>&nbsp;阅读(463)&nbsp;<!--<span class="glyphicon glyphicon-thumbs-up"></span>&nbsp;&nbsp;--><span class="glyphicon glyphicon-edit"></span>&nbsp;评论(0)&nbsp;<span class="glyphicon glyphicon glyphicon-tags"></span>&nbsp;<a
                    href="/Article/soso/keyword/thinkphp.html" class="text-muted">thinkphp</a>&nbsp;<a href="/Article/soso/keyword/压缩页面.html" class="text-muted">压缩页面</a>&nbsp;<a href="/Article/soso/keyword/压缩html.html" class="text-muted">压缩html</a>&nbsp;<a href="/Article/soso/keyword/html压缩.html" class="text-muted">html压缩</a>&nbsp;</small><span class="glyphicon glyphicon-time"></span>&nbsp;7个月前&nbsp;</p>
            <p class="text-muted">在前面的thinkphp如何压缩html页面的文章中介绍了thinkphp压缩页面输出的方法，但是，我觉得扩展性不强，有点死板。由于进一步的学习，这次我重新的修改了代码，让页面压缩更加的灵活方便。自由配置页面压缩的等级。我这里设置为三个等级。第一种：不压缩页面，就是默认的。第二种：保留压缩页面，保留页面中js,css,jq的部分不压缩。适合页面中嵌套许多js,jq,css的朋友。(推荐)第三种：全部压缩页面。毫无保留的全部压缩页面。好了，介绍了上面的三种模式，那我们看怎么去实现。第一步：我们要分</p>
            <hr/>
            <h4><a href="/Article/info/id/208.html" target="_blank" class="text-primary">thinkphp压缩Html页面内容</a></h4>
            <p class="text-muted"><span class="glyphicon glyphicon-th-list"></span>&nbsp;<a href="/Article/cate/id/8.html">Thinkphp</a>&nbsp;<span class="glyphicon glyphicon-user"></span>&nbsp;高蒙&nbsp;<span class="glyphicon glyphicon-eye-open"></span>&nbsp;阅读(721)&nbsp;<!--<span class="glyphicon glyphicon-thumbs-up"></span>&nbsp;&nbsp;--><span class="glyphicon glyphicon-edit"></span>&nbsp;评论(0)&nbsp;<span class="glyphicon glyphicon glyphicon-tags"></span>&nbsp;<a
                    href="/Article/soso/keyword/thinkphp.html" class="text-muted">thinkphp</a>&nbsp;<a href="/Article/soso/keyword/thinkphp压缩.html" class="text-muted">thinkphp压缩</a>&nbsp;<a href="/Article/soso/keyword/页面压缩.html" class="text-muted">页面压缩</a>&nbsp;<a href="/Article/soso/keyword/压缩.html" class="text-muted">压缩</a>&nbsp;</small><span class="glyphicon glyphicon-time"></span>&nbsp;10个月前&nbsp;</p>
            <p class="text-muted">博客做好之后，为了更快的打开页面，我就想把模版的页面全部的压缩一下。thinkphp里面渲染模板都是用display方法。其实，它是继承自Think核心代码里面。\ThinkPHP\Library\Think\View.class.php 查找到display方法大概67行。将下面的两端页面压缩的代码放入进去即可。压缩代码：第一种：将页面压缩html标签 js jq保留 个人比较倾向这个。&nbsp;$content&nbsp;=&nbsp;preg_replace(&quot;~&gt;\s+&lt;~</p>
            <hr/>
            <h4><a href="/Article/info/id/206.html" target="_blank" class="text-primary">实例thinkphp如何使用极验验证码 让验证有趣起来</a></h4>
            <p class="text-muted"><span class="glyphicon glyphicon-th-list"></span>&nbsp;<a href="/Article/cate/id/8.html">Thinkphp</a>&nbsp;<span class="glyphicon glyphicon-user"></span>&nbsp;高蒙&nbsp;<span class="glyphicon glyphicon-eye-open"></span>&nbsp;阅读(978)&nbsp;<!--<span class="glyphicon glyphicon-thumbs-up"></span>&nbsp;&nbsp;--><span class="glyphicon glyphicon-edit"></span>&nbsp;评论(0)&nbsp;<span class="glyphicon glyphicon glyphicon-tags"></span>&nbsp;<a
                    href="/Article/soso/keyword/极验验证码使用.html" class="text-muted">极验验证码使用</a>&nbsp;<a href="/Article/soso/keyword/thinkphp使用极验验证码.html" class="text-muted">thinkphp使用极验验证码</a>&nbsp;<a href="/Article/soso/keyword/极验验证码.html" class="text-muted">极验验证码</a>&nbsp;<a href="/Article/soso/keyword/thinkphp.html" class="text-muted">thinkphp</a>&nbsp;</small><span class="glyphicon glyphicon-time"></span>&nbsp;10个月前&nbsp;</p>
            <p class="text-muted">不知从何时起，很多大的网站都流行用滑动条式图片验证码的形式进行登陆注册的验证。就连淘宝，阿里云也都用上了。所以，我也要去搞个玩玩。刚好在看thinkphp手册的时候，看到了极验验证码的推广广告，出于好奇心就点击进去了。于是乎，我就决定了，要弄个玩玩。既然决定了，那就好好的玩下。下面我就介绍，我们的thinkphp怎么搭载极验验证码。思路都是一样的，其他的程序都是可以的，我这里因为做的是thinkphp,内容有点多，请仔细查看，便于理解。准备阶段：首先我把你要用到的地址贴出来。官网： </p>
            <hr/>
            <h4><a href="/Article/info/id/203.html" target="_blank" class="text-primary">thinkphp 报错 Can't use function return value in write context</a></h4>
            <p class="text-muted"><span class="glyphicon glyphicon-th-list"></span>&nbsp;<a href="/Article/cate/id/8.html">Thinkphp</a>&nbsp;<span class="glyphicon glyphicon-user"></span>&nbsp;高蒙&nbsp;<span class="glyphicon glyphicon-eye-open"></span>&nbsp;阅读(672)&nbsp;<!--<span class="glyphicon glyphicon-thumbs-up"></span>&nbsp;&nbsp;--><span class="glyphicon glyphicon-edit"></span>&nbsp;评论(0)&nbsp;<span class="glyphicon glyphicon glyphicon-tags"></span>&nbsp;<a
                    href="/Article/soso/keyword/Can't use function return value in write context.html" class="text-muted">Can't use function return value in write context</a>&nbsp;<a href="/Article/soso/keyword/thinkphp.html" class="text-muted">thinkphp</a>&nbsp;</small><span class="glyphicon glyphicon-time"></span>&nbsp;10个月前&nbsp;</p>
            <p class="text-muted">博客使用thinkphp全新开发的，刚部署到服务器。页面打开报错Can&amp;#39;t use function return value in write context。报错完整代码：Can&amp;#39;t&amp;nbsp;use&amp;nbsp;function&amp;nbsp;return&amp;nbsp;value&amp;nbsp;in&amp;nbsp;write&amp;nbsp;context错误位置FILE:&amp;nbsp;/alidata/www/newb</p>
            <hr/>
            <h4><a href="/Article/info/id/191.html" target="_blank" class="text-primary">thinkphp model不能使用$this方法</a></h4>
            <p class="text-muted"><span class="glyphicon glyphicon-th-list"></span>&nbsp;<a href="/Article/cate/id/8.html">Thinkphp</a>&nbsp;<span class="glyphicon glyphicon-user"></span>&nbsp;高蒙&nbsp;<span class="glyphicon glyphicon-eye-open"></span>&nbsp;阅读(549)&nbsp;<!--<span class="glyphicon glyphicon-thumbs-up"></span>&nbsp;&nbsp;--><span class="glyphicon glyphicon-edit"></span>&nbsp;评论(0)&nbsp;<span class="glyphicon glyphicon glyphicon-tags"></span>&nbsp;<a
                    href="/Article/soso/keyword/thinkphp.html" class="text-muted">thinkphp</a>&nbsp;<a href="/Article/soso/keyword/model不能使用$this方法.html" class="text-muted">model不能使用$this方法</a>&nbsp;</small><span class="glyphicon glyphicon-time"></span>&nbsp;10个月前&nbsp;</p>
            <p class="text-muted">在开发中遇到很奇怪的问题，就是我用D()方法去继承Model的时候，总是使用不到里面的方法。参数怎么传递，都是无效的。控制器indexController.class.phpnamespace Admin\Controller;use Think\Controller;class MemberController extends Controller{ public function&amp;</p>
            <hr/>
            <h4><a href="/Article/info/id/145.html" target="_blank" class="text-primary">[CI快速入门教程2]ci的使用以及完整的MVC案例</a></h4>
            <p class="text-muted"><span class="glyphicon glyphicon-th-list"></span>&nbsp;<a href="/Article/cate/id/5.html">CodeIgniter</a>&nbsp;<span class="glyphicon glyphicon-user"></span>&nbsp;高蒙&nbsp;<span class="glyphicon glyphicon-eye-open"></span>&nbsp;阅读(551)&nbsp;<!--<span class="glyphicon glyphicon-thumbs-up"></span>&nbsp;&nbsp;--><span class="glyphicon glyphicon-edit"></span>&nbsp;评论(2)&nbsp;<span class="glyphicon glyphicon glyphicon-tags"></span>&nbsp;<a
                    href="/Article/soso/keyword/ci 完整MVC案例.html" class="text-muted">ci 完整MVC案例</a>&nbsp;<a href="/Article/soso/keyword/CI快速入门教程.html" class="text-muted">CI快速入门教程</a>&nbsp;</small><span class="glyphicon glyphicon-time"></span>&nbsp;1年前&nbsp;</p>
            <p class="text-muted"> ci MVC完整案例使用mvc来完成一个新闻的一组操作----增删改查。1.准备工作书写一个news控制器，设计一张表Ci操作数据库1)数据库相关配置，在config/database.php2)连接数据</p>
            <hr/>
            <h4><a href="/Article/info/id/144.html" target="_blank" class="text-primary">[CI快速入门教程1]初步了解ci以及安装、视图、控制器的定义</a></h4>
            <p class="text-muted"><span class="glyphicon glyphicon-th-list"></span>&nbsp;<a href="/Article/cate/id/5.html">CodeIgniter</a>&nbsp;<span class="glyphicon glyphicon-user"></span>&nbsp;高蒙&nbsp;<span class="glyphicon glyphicon-eye-open"></span>&nbsp;阅读(457)&nbsp;<!--<span class="glyphicon glyphicon-thumbs-up"></span>&nbsp;&nbsp;--><span class="glyphicon glyphicon-edit"></span>&nbsp;评论(0)&nbsp;<span class="glyphicon glyphicon glyphicon-tags"></span>&nbsp;<a
                    href="/Article/soso/keyword/CI快速入门教程.html" class="text-muted">CI快速入门教程</a>&nbsp;<a href="/Article/soso/keyword/ci框架.html" class="text-muted">ci框架</a>&nbsp;</small><span class="glyphicon glyphicon-time"></span>&nbsp;1年前&nbsp;</p>
            <p class="text-muted">CI快速入门教程1.获取与安装直接上官网下载http://codeigniter.org.cn/ ，目前最新版本是2.1.4将下载好的文件解压打网站根目录，在页面中直接访问，输入如http://localhost/cites</p>
            <hr/><!--分页 begin-->
            <nav class="text-center">
                <ul class="pagination">
                    <div class='pagination'>
                        <li class="rows"><a href="#fakelink">1/2页 共 22 条</a></li>
                        <li class="disabled"><a href="#fakelink">«</a></li>
                        <li class="disabled"><a href="#fakelink">‹</a></li>
                        <li class="active"><a href="/index.php/Article/cate/id/2/page/1.html">1</a></li>
                        <li><a href="/index.php/Article/cate/id/2/page/2.html">2</a></li>
                        <li><a href="/index.php/Article/cate/id/2/page/2.html">›</a></li>
                        <li class="disabled"><a href="#fakelink">»</a></li>
                    </div>
                </ul>
            </nav><!--分页 end--></div>
        <div class="col-md-3 bg-fff  hidden-xs hidden-sm "><h4>全部板块</h4>
            <div class="b-t-hx"></div>
            <ul class="p-l-10 list-style p-b-10 ol-b-k">
                <li><a href="/Article/cate/id/1.html">PHP笔记</a></li>
                <li><a href="/Article/cate/id/19.html">++&nbsp;PHP工具</a></li>
                <li><a href="/Article/cate/id/20.html">++++&nbsp;Phpstorm</a></li>
                <li><a href="/Article/cate/id/2.html">++&nbsp;PHP框架</a></li>
                <li><a href="/Article/cate/id/5.html">++++&nbsp;CodeIgniter</a></li>
                <li><a href="/Article/cate/id/6.html">++++&nbsp;zend framework</a></li>
                <li><a href="/Article/cate/id/7.html">++++&nbsp;Yii2</a></li>
                <li><a href="/Article/cate/id/8.html">++++&nbsp;Thinkphp</a></li>
                <li><a href="/Article/cate/id/21.html">++&nbsp;数据采集</a></li>
                <li><a href="/Article/cate/id/30.html">++++&nbsp;火车头采集器</a></li>
                <li><a href="/Article/cate/id/3.html">++&nbsp;CMS系统</a></li>
                <li><a href="/Article/cate/id/10.html">++++&nbsp;EmpireCMS</a></li>
                <li><a href="/Article/cate/id/11.html">++++&nbsp;EcshopCMS</a></li>
                <li><a href="/Article/cate/id/12.html">++++&nbsp;DestoonCMS</a></li>
                <li><a href="/Article/cate/id/13.html">++++&nbsp;DiscuzCMS</a></li>
                <li><a href="/Article/cate/id/9.html">++++&nbsp;DedeCMS</a></li>
                <li><a href="/Article/cate/id/4.html">++&nbsp;PHP技术</a></li>
                <li><a href="/Article/cate/id/17.html">++++&nbsp;Redis</a></li>
                <li><a href="/Article/cate/id/18.html">++++&nbsp;Memcached</a></li>
                <li><a href="/Article/cate/id/22.html">++++&nbsp;PHP</a></li>
                <li><a href="/Article/cate/id/26.html">++&nbsp;其他知识</a></li>
                <li><a href="/Article/cate/id/14.html">前端技术</a></li>
                <li><a href="/Article/cate/id/15.html">++&nbsp;jQuery/js</a></li>
                <li><a href="/Article/cate/id/16.html">++&nbsp;Html/Css</a></li>
                <li><a href="/Article/cate/id/29.html">++&nbsp;Bootstrap</a></li>
                <li><a href="/Article/cate/id/23.html">服务器</a></li>
                <li><a href="/Article/cate/id/24.html">++&nbsp;Linux</a></li>
                <li><a href="/Article/cate/id/25.html">++&nbsp;Nginx</a></li>
                <li><a href="/Article/cate/id/27.html">数据库</a></li>
                <li><a href="/Article/cate/id/28.html">++&nbsp;Mysql</a></li>
                <li><a href="/Article/cate/id/35.html">++&nbsp;SQL SERVER</a></li>
                <li><a href="/Article/cate/id/31.html">资源分享</a></li>
                <li><a href="/Article/cate/id/33.html">++&nbsp;PHP(OOP)编程入门</a></li>
                <li><a href="/Jquery.html">++&nbsp;jQuery手册</a></li>
                <li><a href="/Article/cate/id/37.html">++&nbsp;jQuery插件</a></li>
                <li><a href="/Article/cate/id/32.html">闲言碎语</a></li>
            </ul>
            <h4>热门文章</h4>
            <div class="b-t-hx"></div>
            <ul class="p-l-10">
                <li><a href="/Article/info/id/79.html" class="">phpstorm10.0.3破解版安装教程及汉化方法</a></li>
                <li><a href="/Article/info/id/71.html" class="">bootstrap响应式图片自适应图片大小</a></li>
                <li><a href="/Article/info/id/83.html" class="">如何让phpstorm同一窗口能打开多个项目目录</a></li>
                <li><a href="/Article/info/id/175.html" class="">实现echarts 饼图 点击链接跳转</a></li>
                <li><a href="/Article/info/id/229.html" class="">如何监听html5 audio音频是否播放完毕</a></li>
                <li><a href="/Article/info/id/227.html" class="">Android webView加载Html5页面，JS不能调用问题和click事件无效的解决方法</a></li>
                <li><a href="/Article/info/id/230.html" class="">ios加载html5 audio标签用js调用.play()方法无效</a></li>
                <li><a href="/Article/info/id/76.html" class="">yii2框架安装运行init.bat报错php.exe不是内部或外部命令</a></li>
                <li><a href="/Article/info/id/33.html" class="">火车头采集器帝国cms发布模块</a></li>
                <li><a href="/Article/info/id/73.html" class="">yii2框架安装教程(框架版本2.0)</a></li>
            </ul>
            <h4>最新文章</h4>
            <div class="b-t-hx"></div>
            <ul class="p-l-10">
                <li><a href="/Article/info/id/649.html" class="">以图搜图 我知图 相似图像搜索与推荐API服务 PHP接口类文档</a></li>
                <li><a href="/Article/info/id/648.html" class="">如何用js判断图片地址是否正确</a></li>
                <li><a href="/Article/info/id/647.html" class="">360 火狐 谷歌浏览器设置代理服务器</a></li>
                <li><a href="/Article/info/id/646.html" class="">整理常用thinkphp的模型操作方法</a></li>
                <li><a href="/Article/info/id/645.html" class="">php &amp;not禁止转义字符</a></li>
                <li><a href="/Article/info/id/644.html" class="">如何使用thinkphp路由正则表达式优化地址链接</a></li>
                <li><a href="/Article/info/id/643.html" class="">php使用dblib扩展,连接sqlserver中文乱码问题</a></li>
                <li><a href="/Article/info/id/642.html" class="">js实现鼠标移动放大图片功能</a></li>
                <li><a href="/Article/info/id/641.html" class="">解决jQuery ajax动态新增节点绑定多个事件无效的问题</a></li>
                <li><a href="/Article/info/id/640.html" class="">整理使用ajax开发搜索功能中遇到的问题以及解决的方法</a></li>
            </ul>
            <script type="text/javascript">                    /*方形广告 240*240 创建于 2016/10/6*/
            var cpro_id = "u2780622";                </script>
            <script type="text/javascript" src="http://cpro.baidustatic.com/cpro/ui/c.js"></script>
            <!-- <h4>友情连接</h4><div class="b-t-hx"></div><ol class="p-l-10 list-inline list-unstyled p-b-10"><li><a href="http://www.xstnet.com" target="_blank" title="春风博客">春风博客</a></li><li><a href="http://www.vuln.cn" target="_blank" title="合肥seo">合肥seo</a></li><li><a href="http://blog.yzmcms.com/" target="_blank" title="袁志蒙博客">袁志蒙博客</a></li><li><a href="http://www.cc1021.com" target="_blank" title="程成博客">程成博客</a></li></ol>--></div>
    </div>
</div><!--content end-->
<script src="./js/jquery.min.js"></script>
<script src="./js/bootstrap.min.js"></script>
<script src="./js/jquery.validate.min.js"></script>
<script src="./js/messages_zh.js"></script>
<script src="./js/layer.js"></script>
<script src="./js/core.js"></script>
<script src="./js/jquery.lazyload.min.js"></script>
<script src="./js/prettify.js"></script>
<script src="./js/layer.js"></script>
<!--footer begin-->
<div class="container m-t-10 bg-fff p-t-10">
    <div class="row">
        <div class="col-md-12"><p class="text-muted">Copyrights &copy; 2016-2017 <a href="http://www.shuchengxian.com" title="高蒙个人博客" 　target="_blank">高蒙个人博客</a> www.shuchengxian.com, All rights reserved. 皖ICP备15015490号 <a target="_blank" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=34152302000022" target="_blank">皖公网安备 34152302000022号</a><a href="http://www.shuchengxian.com/sitemap.xml" target="_blank">网站地图</a></p>
            <p class="text-muted">关键词：个人博客,PHP博客,PHP博客程序,高蒙博客,高蒙个人博客,php程序员博客,程序员个人博客</p></div>
    </div>
</div><!--footer end--><!--login model begin-->
<div class="modal fade" id="mylogin" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document" style="width: 50%;">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel">登录·注册</h4></div>
            <div class="modal-body" style="overflow: hidden;">
                <div class="col-md-12">
                    <div class="col-md-6">
                        <form action="/Login/loginIn.html" method="post" style="border-right:1px #eee solid;" id="LoginIn">
                            <div class="form-group "><p>用户登录：</p>
                                <div>
                                    <div class="input-group">
                                        <div class="input-group-addon"><span class="glyphicon glyphicon-user"></span></div>
                                        <input type="text" name="username" class="form-control" id="username" placeholder="用户名" style="width: 80%;"></div>
                                </div>
                                <p class="p-t-10">登录密码：</p>
                                <div>
                                    <div class="input-group">
                                        <div class="input-group-addon"><span class="glyphicon glyphicon-tasks"></span></div>
                                        <input type="password" name="password" id="password" class="form-control" placeholder="密码" style="width: 80%;"></div>
                                </div>
                                <p class="p-t-10">快速登录：</p>
                                <div class="input-group"><a href="https://graph.qq.com/oauth2.0/authorize?response_type=code&client_id=101349259&redirect_uri=http://www.shuchengxian.com/Login/QQAuth.html&scope=get_user_info" target="_blank"><img src="./images/Connect_logo_3.png"></a>&nbsp;<a href="https://api.weibo.com/oauth2/authorize?client_id=1489731477&redirect_uri=http://www.shuchengxian.com/Login/weiBoAuth.html&scope=users/show&state=shuchengxian.com"
                                                                                                                                                                                                                                                                                                                                  target="_blank"><img src="./images/weibo_logo_3.png"></a></div>
                                <p class="p-t-10"></p>
                                <div class="input-group">
                                    <button type="submit" class="btn btn-success">登录</button>
                                </div>
                            </div>
                        </form>
                    </div>
                    <div class="col-md-6">
                        <form action="/Login/regist.html" method="post" id="Login_regist">
                            <div class="form-group "><p>创建新账号：</p>
                                <div>
                                    <div class="input-group">
                                        <div class="input-group-addon"><span class="glyphicon glyphicon-user"></span></div>
                                        <input type="text" class="form-control" name="user" id="user" placeholder="字母、数字等 用户名唯一" style="width: 80%;"></div>
                                </div>
                                <p class="p-t-10">设置密码：</p>
                                <div>
                                    <div class="input-group">
                                        <div class="input-group-addon"><span class="glyphicon glyphicon-tasks"></span></div>
                                        <input type="password" class="form-control" name="pwd" id="pwd" placeholder="密码" style="width: 80%;"></div>
                                </div>
                                <p class="p-t-10">电子邮箱：</p>
                                <div>
                                    <div class="input-group">
                                        <div class="input-group-addon"><span class="glyphicon glyphicon-envelope"></span></div>
                                        <input type="text" class="form-control" name="email" id="email" placeholder="电子邮箱 认真填写,可找回密码！" style="width: 80%;"></div>
                                </div>
                                <div class="checkbox">
                                    <div class="col-md-8"><input type="checkbox" name="checkin" value="1" disabled checked>同意<a href="javascript:(0);">网站服务条款</a></div>
                                    <div class="col-md-4">
                                        <button type="submit" id="embed-submits" class="btn btn-success">注册</button>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <!--<button type="button" class="btn btn-danger">忘记密码？</button><button type="button" class="btn btn-info" data-toggle="modal" data-target="#myregist">免费注册</button>--></div>
        </div>
    </div>
</div><!--login model end-->
<script type="text/javascript">
    var cpro_id = "u2780609";    </script>
<script src="http://cpro.baidustatic.com/cpro/ui/c.js" type="text/javascript"></script>
<script type="text/javascript">                var cpro_id = "u2780615";    </script>
<script type="text/javascript" src="http://cpro.baidustatic.com/cpro/ui/i.js"></script>
<script>
    $(function () {
        $("img.lazy").lazyload({effect: "fadeIn"});
    });
</script>
<script type="text/javascript">
    var cpro_id = "u2908581";
</script>
<script type="text/javascript" src="http://cpro.baidustatic.com/cpro/ui/i.js"></script>
</body>
</html>